Materialized query tables with shared data

ABSTRACT

A computer system can generate a materialized query table (MQT) for data from a base table that has a plurality of rows and columns that each contain stored data. The computer system can receive a query to data stored in a row from the base table. The system can identify a column in the row and determine that data from a cell in the row and the column is above a threshold memory size. The system can generate, in response to determining that the data being above the threshold memory size, an MQT that includes data for the row and that includes a reference pointer that points to a location shared with another table.

BACKGROUND

The present disclosure relates to materialized query tables (MQTs), andmore specifically, to generating MQTs that share data from a base table.

Data can be stored in and accessed from a database. In variousembodiments, a database contains a base table, which has rows of datathat can be accessed using queries. A query can be one or morestatements interconnected with logical operators. The base table can bequeried to obtain a result (data) to the query. In certain embodiments,a base table can contain large amounts of data, and the time it takes toreturn a result to a query can be significant. Furthermore, inparticular embodiments, the same data can be accessed multiple times. Asa result, the same or similar queries can be used multiple times.

Materialized query tables (MQT) are defined based upon the result of aquery. The data that is contained in an MQT can derived from one or morebase tables on which the materialized query table definition is based.In many respects, an MQT is a kind of materialized view. Both views andMQTs are defined on the basis of a query. An MQT stores the queryresults as data in memory location separate from the underlyingtable(s). This allows the data stored in the MQT to be used instead ofthe data that is in the underlying tables. Materialized query tables cansignificantly improve the performance of queries, especially complexqueries. If the optimizer determines that a query or part of a querycould be resolved using an MQT, the query might be rewritten to takeadvantage of the MQT.

SUMMARY

Embodiments are directed toward a method for generating a materializedquery table (MQT) for data from a base table having a plurality of rowsand columns that contain stored data. A computer system can receive aquery to data stored in a row from the base table and identify a columnin the row. The computer system can determine that data from a cell inthe row and the column is above a threshold memory size. In response todetermining that the data is above the threshold memory size, thecomputer system can generate the MQT from data for the row and with areference pointer that points to a location that is shared with anothertable.

According to embodiments, a database manager system is provided forcreating a materialized query table (MQT) for data from a base tablehaving a plurality of rows and columns that contain stored data. Thesystem can include one or more computer processor circuits that areconfigured to; receive a query to a row from the base table; identify acolumn in the row; determine that data from the column is above athreshold memory size; and generate, in response to determining that thedata is above the threshold memory size, the MQT with a referencepointer that points to a location of the data that is in another table.

Various embodiments are directed toward a computer program product forgenerating a materialized query table (MQT) for data from a base tablehaving a plurality of rows and columns that contain stored data, thecomputer program product comprising a computer readable storage mediumhaving program instructions embodied therewith, wherein the computerreadable storage medium is not a transitory signal per se, the programinstructions executable by a processing circuit to cause the processingcircuit to perform a method comprising: receiving a query to a row fromthe base table; identifying a column in the row; determining that datafrom a cell in the row and the column is above a threshold memory size;and generating, in response to determining that the data is above thethreshold memory size, the MQT from data for the row and with areference pointer that points to a location that is shared with anothertable.

The above summary is not intended to describe each illustratedembodiment or every implementation of the present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The drawings included in the present application are incorporated into,and form part of, the specification. They illustrate embodiments of thepresent disclosure and, along with the description, serve to explain theprinciples of the disclosure. The drawings are only illustrative ofcertain embodiments and do not limit the disclosure.

FIG. 1 depicts a system 100 for creating an MQT for data from a basetable, consistent with embodiments of the present disclosure;

FIG. 2 depicts an example 200 of generating MQTs that share data from abase table, consistent with embodiments of the present disclosure;

FIG. 3 depicts an example 300 of generating MQTs that share data from abase table, consistent with embodiments of the present disclosure;

FIG. 4 depicts an example 400 of generating MQTs that share data from abase table, consistent with embodiments of the present disclosure;

FIG. 5 depicts a method 500 of generating MQTs that share data from abase table, consistent with embodiments of the present disclosure;

FIG. 6 depicts a cloud computing node, according to embodiments of thepresent disclosure;

FIG. 7 depicts a cloud computing environment, according to embodimentsof the present disclosure; and

FIG. 8 depicts abstraction model layers, according to embodiments of thepresent disclosure.

While the invention is amenable to various modifications and alternativeforms, specifics thereof have been shown by way of example in thedrawings and will be described in detail. It should be understood,however, that the intention is not to limit the invention to theparticular embodiments described. On the contrary, the intention is tocover all modifications, equivalents, and alternatives falling withinthe spirit and scope of the invention.

DETAILED DESCRIPTION

Aspects of the present disclosure relate to materialized query tables(MQTs), more particular aspects relate to generating MQTs that sharedata from a base table. While the present disclosure is not necessarilylimited to such applications, various aspects of the disclosure may beappreciated through a discussion of various examples using this context.

Embodiments of the present disclosure are directed toward generatingMQTs that share data from a base table. In various embodiments, largeamounts of data (e.g., large objects (LOBs)) may be located in one ormore columns of a row that has been queried multiple times. As a result,storing the row in multiple MQTs may reduce the performance of a systemwhere the MQTs are stored and can also use a large amount of storage ormemory space.

The term LOB can refer to a set of data types that are designed to holdlarge amounts of data. For example, a LOB type can be configured tostore data up to a certain size (e.g., ranging from 8 terabytes to 128terabytes) depending on how the database is configured. The use of aspecially designed data type can facilitate accessing of, andmanipulation of, the data by an application. Consistent withembodiments, there can be specific types of LOBs that are designed forstoring data in different formats, which can be useful for differentdata content. For example, character/textual data can be stored as acharacter-LOB (CLOB), while image (or other) data could be stored asbinary-LOB (BLOB).

According to certain embodiments, when a query is made to a row of abase table, a cell with the large amount of data can be identified. Insome instances, this cell can correspond to a LOB column. In certainembodiments, a threshold memory size may be set and the cell with thelarge amount of data can be compared to the threshold memory size. Theresult of the query can be the generation of an MQT that includes therow. The system can be configured to use the threshold memory size todetermine whether or not the MQT will store the entire data from thecell, or a pointer to another location. For instance, if the memory sizeof the cell with the large amount of data is above the threshold memorysize, the MQT can include a reference pointer (e.g., a LOB locator) thatpoints to another location that stores the large amount of data. In someembodiments, the reference pointer to the large amount of data can pointdirectly to the base table. In certain embodiments, the materializedversion of the large amount of data may be stored in another MQT (foranother query) or some other storage location used by the databasemanagement system. If direct access to the data is subsequentlyrequested, e.g., by a query to the MQT or a request to store the data ina file, the reference pointer can be used to locate the data thatsatisfies the query.

In particular embodiments, an index can be used in conjunction with theMQT. In various embodiments, a database manager can create the index tolocate the MQT that will be used to satisfy the query. In someinstances, the index can facilitate sharing of common data items betweendifferent MQTs, between MQTs and the base table, or both. When access toan MQT is requested, the index may indicate that a particularmaterialized object is stored elsewhere, e.g., another MQT or the basetable. As discussed herein, the index can be broken down to the celllevel, allowing for individual pointers to be created and used basedupon the memory size of the cell.

According to various embodiments, a base table can be a temporary tablegenerated from a query over one or more tables. These base tables can beuseful to save time and effort. In particular embodiments, the basetable can contain results to queries that are similar or have somethingin common. For example, a base table can be joined from the same tablesor created using the same or similar group criteria. In certainembodiments, there can be complex or large amounts of data in a basetable. MQTs are tables that can contain information that is derived andsummarized from base tables. MQTs can be created to store rows that havebeen queried multiple times in a more convenient storage location (e.g.,a faster or otherwise more easily accessible storage space) by avoidingredundant performance of scanning, aggregation and join operations.

In certain embodiments, a database manager can implicitly create MQTsfor rows that have been queried multiple times. For example, when aquery is made multiple times to one or more rows of a base table, adatabase manager can implicitly create an MQT for the query. When thequery is made again, the database manager can direct the query to selectthe row from the MQT rather than the base table. In another embodiment,MQTs can be created by human administrators to store rows that have beenqueried multiple times. As a result, multiple MQTs can be created forsome or all of the data that is located in a base table. Thus, when aquery is made, the access times for retrieving the data from the storagelocation of the corresponding MQT can be less than access times forretrieving the data from the base table.

In various embodiments, multiple queries may query different columns ofthe same row. As a result, the row may be copied and stored in multipleMQTs. For example, the result for query 1 is located in column 1 of row1 and the result for query 2 is located in column 2 of row 1. Query 1and query 2 have been made multiple times and the database manager hasgenerated MQT 1 and MQT 2 and stored row 1 in both MQTs. When query 1 ismade again, MQT 1 can be accessed to retrieve the result from column 1of row 1. When query 2 is made again, MQT 2 can be accessed to retrievethe result from column 2 of row 1.

In particular embodiments, one or more columns of a row may contain datathat requires a lot of storage space (e.g., 100 Gigabyte LOBs). Copyingthe row to multiple MQTs could hinder the performance of the system ifthe LOB is materialized separately for each MQT. According to certainembodiments, the system can determine that an MQT will not store aseparate copy for a cell with a large amount of data. This determinationcan be based upon the memory size of the cell and the availability ofthe data in another location. The cell in the MQT can store a referencepointer to other location. If a query to the MQT seeks to retrieve thecell with the large amount of data, the reference pointer can be used toaccess the large amount of data, e.g., from another MQT or the basetable. The data for the cell can then be retrieved for the query. Insome embodiments, the reference pointer may point to a separate storageapplication that was specifically created to store the large amount ofdata or multiple large amounts of data.

Consistent with embodiments, the system can be configured to makedetermination as to whether or not to include data in an MQT on a cellby cell basis. This can be particularly useful for handling LOB columnsin which the amount of data stored in any particular row can varysignificantly. Thus, the system can be configured to directly include,in an MQT, data from one cell of a LOB column, while using a pointer foranother cell. Moreover, various embodiments allow for tailoring of thememory threshold sizes used in this decision. For instance, certain datatypes may be given different memory threshold sizes based. This mayaccount for different expected usage of the data types, different memoryconstraints, and different performance considerations. For instance, thesystem could be configured to have a high memory threshold size forbinary LOBs (BLOBs) that is higher than a corresponding memory thresholdsize for character LOBs (CLOBs). Thus, a BLOB cell having the samememory size as a CLOB cell can be treated differently. In certaininstances, the memory threshold size can by dynamically adjusted. Forinstance, the memory threshold size could be dynamically reduced inresponse to increased memory usage. The change could then be implementedon future MQT creation events and, if desired, memory used by cells inexisting MQTs could also be freed if they are above the new thresholdmemory size.

As a particular example, an enterprise database may store employee data,and a base table can be created from the database. Three queries may bedirected to the base table regarding employee 1. The first query may askfor employee 1's salary and visual image, the second query may ask foremployee 1's address and visual image, and the third query may ask forjust a visual image of employee 1. The result (data) for the threecommon queries can be located in the same row in the base table. In thisembodiment, a database manager can generate three MQTs for each query.MQT 1 can be generated to provide the data for employee 1's salary andvisual image, MQT 2 can be generated to provide the data for employee2's address and visual image, and MQT 3 can be generated to provide thedata for the visual image of employee 1. As a result, the same row maybe copied to all three MQTs. However, according to various embodiments,the database manager can determine that the data the memory size for theobject representing the visual image of employee 1 exceeds a thresholdmemory size. The row may then be copied to MQT 1 along with the data forthe visual image of employee 1. When MQT 2 and MQT3 are created, the rowdoes not include the data for the visual image because a referencepointer is created to refer to the storage location of the data used byMQT 1. The system can then respond to a subsequent access to MQT 2 orMQT 3 by using the reference pointer to locate storage locationassociated with MQT 1 and the data for the visual image can beretrieved. Sharing the large amount of data between the MQTs in thismanner can be particularly useful for alleviating the system fromstoring the large amount of data multiple times and allowing anefficient response to queries.

FIG. 1 depicts a computer system 100 for creating an MQT for data from abase table, consistent with embodiments of the present disclosure. Asshown, the system can include a database storage server 102,communication network 140, and clients 118, 120, 122. The system caninclude one or more computer processors, memories and related hardwarecomponents that are configured consistent with the discussion herein.

Various embodiments of the database storage server 102 can includestorage devices 104 and a database manager 110. Database storage server102 can allow a computer (e.g., servers, personal computers, and mobiledevices) to store large amounts of data, which can be searched by a userin order to retrieve specific information in storage devices 104, 128,and 130. Storages devices 104, 128, and 130 can be devices (e.g., singlein-line memory modules, dual in-line memory modules, hard disks,magnetic tapes, and compact discs) on which a database 106, a base table108, and MQTs 116, 136, and 138 can be stored. Data stored in thedatabase 106 can be arranged into tables, such that the tables have rowsand columns of data. In certain embodiments, a table that can exist inthe storage device 104 is the base table 108 and the MQT 116.

In particular embodiments, as stated herein, accessing data from thebase table 108 can be done using queries. A query can be sent fromclients 118, 120, and 122. As shown, in some embodiments, clients 120and 122 can be communicatively coupled to the data storage server 102using one or more communication networks 140. The network 140 mayinclude wide area networks (such as the Internet), local area networksthat can include one or more servers, networks, or databases, and mayuse a particular communication protocol to transfer data between theentities included in system 100.

Queries sent from clients 118, 120, and 122 can be logical statementsthat, according to certain embodiments, can be evaluated by databasemanagers 110, 124, or 126. The queries can then be used to retrieve datafrom the base table 108. For example, database storage server 102 can bea server that houses storage 104 that contains data for an enterprise.The base table 108 can contain data about the employees of theenterprise, with columns in the base table that represent the employee'sname, address, phone number, gender, and salary. A query can then beused to retrieve the records for all exempt employees that have a salarygreater than $60,000. Similarly, a query can be used to retrieve therecords for all employees that have a particular area code or telephoneprefix.

Consistent with various embodiments, identical or closely relatedqueries can be issued multiple times. To respond to queries, thedatabase managers 110, 124, and 126 may have to perform numerous joinoperations because the base table contains the data required to providethe results to the queries. When the base table contains large amountsof data, queries directed to the base table can take a long time toexecute.

Particular embodiments can have the database manager 110, 124, and 126store the results of queries in MQTs 116, 136, and 138. The databasemanager can be located at a central location 110, or can be located inmultiple locations 110, 124, and 126 (e.g., using a federated databasethat is spread around multiple nodes). The MQTs 116, 136, and 138 cancontain the rows or a subset of the rows from the base table 108.Therefore, a query made multiple times can be received and the resultscan be stored in the MQTs 116, 136, and 138. When the query is receivedagain, the query can be directed to the MQT and the MQT can provide theresult (data) to the query. By using the MQT, the time it would havetaken gathering and delivering the data if the query would have beendirected to the base table 108, can be reduced. In certain embodiments,using a process known as query rewrite, a query can be recognized bydatabase managers 110, 124, and 126 and directed to the MQTs 116, 136,and 138 to provide the results to the query.

Furthermore, according to particular embodiments, indexes 114, 132, and134 can be configured with index values that map the locations of theMQTs. Therefore, when a query is made, the location of rows for the MQTassociated with the query can be found using the index. For cellscontaining LOB values, the index may identify a different storagelocation for the individual cell, relative to the location of the othercells in the row. In addition, multiple queries can be sent by client120. In certain embodiments, the index 114 can be used to identify theMQTs that are needed to provide the results to each of the queries.Moreover, the index 114 can be used to facilitate sharing of rows orcells that are common to multiple MQTs. In certain instances, thedecision on whether to share can be made for individual cells, asopposed to entire rows, and based upon the memory size of the cells.

As an example, client 120 sends query 1 for each employee's annualsalary and query 2 for a visual image of each employee. Because thereare multiple employees, queries 1 and 2 are made multiple times. As aresult, the database manager 110 generates MQT 1 for query 1 and MQT 2for query 2. Each employee may have a row of data in the base table 108and each row can contain one column of data for the employee's salaryand one column of data for a visual image of the employee. The databasemanager may determine that the data for a visual image of certainemployees is large and above a threshold memory size. If the visualimage data were to be copied several times in both MQT 1 and MQT 2, theperformance of the system 100 may suffer. The database manager may thengenerate MQT 1 by creating a materialized table that includes all therelevant rows of data for the employees. The database manager may thengenerate MQT 2 by creating a materialized table that includes allrelevant rows of data for the employees, while using, for cells above amemory threshold, pointers back to MQT 1. In some instances, the systemcan use reference pointers that point to the visual image data locatedin base table 108. Whether the data is stored in another MQT or in thebase table, index 114 can be used to locate the shared location for suchdata.

FIG. 2 depicts an example 200 of generating MQTs that share data from abase table, consistent with embodiments of the present disclosure. Inparticular embodiments, the example 200 can include a base table 202,MQTs 204, 206, an index 214, and queries 220, 222. The base table 202can include a superset of data relative to the MQTs, which include asubset of data defined by their respective queries. This is both in thehorizontal sense (columns) and in the vertical sense (Rows). For ease ofdiscussion, these additional columns and rows are not depicted in thebase table. Moreover, each of the MQTs may have more or less columnsthan is depicted. For example, a first MQT might have columns 1 and 3while another MQT might have columns 2 and 3, where 3 is the LOB column.For ease of discussion, the columns are shown as being common betweenthe MQTs.

According to various embodiments, queries 220 and 222 can be made to thebase table 202 from a client (e.g. clients 118, 120, and 122, from FIG.1). Query 220 can be made for employee 1, 2, and 3's salary and query222 can be made for a visual image of employees 1, 2, and 3. In certainembodiments, a database manager (e.g., database manager 110 and 126,from FIG. 1) may recognize that queries 220 and 222 have been issuedmultiple times (in this example instance, each query has or will beissued 3 times and each row has or will be queried twice) and thedatabase manager can decide to generate MQTs 204 and 206 for queries 222and 220, respectively. In certain embodiments, MQT 206 can be generatedfirst for query 220 and the data for rows for employees 1, 2, and 3 canbe stored to create MQT 206. When query 222 is subsequently issued, thedatabase manager may then determine whether the storage size of the datain each column of the rows for employees 1, 2, and 3 are above athreshold memory size. As discussed herein, the threshold memory sizecan be determined based on many factors, including but not limited to,the storage capacity of a system (e.g., database storage server 102,client 118, and client 122), preference settings set by the databasemanager or a human administrator, and the number of join operationsrequired to retrieve a result to a query.

In certain embodiments, the database manager may determine that thestorage size of the data for employee 1, 2, and 3's salary (in thiscase, 10 bytes) is below the threshold memory size and copy the datainto MQT 204. The database manager may then determine that the storagesize of the data for the visual image of employees 1, 2, and 3 (in thiscase, 100 gigabytes) is above the threshold memory size. The databasemanager can then include reference pointers 208, 210, and 212 with MQT204. Reference pointer 208 can provide the location of the data for thevisual image of employee 1 by pointing to the storage location for thecorresponding cell in MQT 206. Similarly, reference pointer 210 canprovide the storage location of the data for the visual image ofemployee 2, and reference pointer 212 can provide the storage locationof the data for the visual image of employee 3.

In particular embodiments, index 214 can be configured to includestorage space pointers 216 and 218. If or when query 222 is made to thebase table 202 for employee 1, 2, or 3's visual image, the databasemanager can access index 214 and use storage space pointer 216 to locateMQT 204. If query 222 was made for employee 1's visual image, referencepointer 208 can be used to locate the cell in MQT 206 for employee 1'svisual image data. The data can then be retrieved from MQT 206 tosatisfy query 222. Similarly, reference pointers 210 and 212 can be usedto locate the data for the visual image of employee 2 or employee 3 tosatisfy query 222. In addition, if or when query 220 is made to the basetable 202 for employee 1, 2, or 3's salary, the database manager canaccess index 214 and use storage space pointer 218 to locate MQT 206. Ifquery 220 was made for employee 1's salary, the cell in MQT 206 of thedata for employee 1's salary can be located and the data can beretrieved to satisfy query 220. Similarly, storage space pointer 218 canbe used to locate MQT 206 and the data for employee 2 and employee 3'ssalary can be retrieved to satisfy query 220.

Consistent with embodiments, an index can be generated for each MQT andcan include references to other MQTs. For instance, the index for MQT 1can be generated according to the following pseudo code:

create index mqtIndex on mqt1 (LobColumnName); //syntax data, mqt,offset or ptr //index structure -------------------------------- ‘abc’ 1000000002780 ‘xyz’ 1  000000005784 ‘def’  2  000000001234

In this example, the data from MQT1 and corresponding to “def” is storedin a location corresponding to MQT2 and the offset “1234”. The index forMQT2 would also include a corresponding index entry for the ‘def” data,which would indicate that the data was stored as part of MQT2. The indexfor MQT2 could also include pointers to other MQTs, including but notlimited to, MQT2.

In various embodiments, MQTs 204 and 206 can be further configured witha share parameter that can be used to determine whether an MQT willshare data with another MQT. For example, if MQT 206 is to share thevisual image data for employees 1, 2, and 3, MQT 206 can have the shareparameter set to ‘Yes’. Therefore, the rows from the base table 202 thatare included in MQT 206 can be shared with MQT 204 (assuming they meetother criteria, such as the memory threshold size). However, if sharingis not desired for MQT 206, MQT 206 can have the share parameter set to‘No’. As a result, the rows from the base table that are included in MQT206 will not be shared with MQT 204 and pointers will not be generatedto or from MQT 206. In certain embodiments, as will be discussed inconnection with FIG. 4, reference pointers 208, 210, and 212 can beconfigured to point back to the base table 202 to locate the visualimage data for employees 1, 2, and 3.

In particular embodiments, the share parameter can be manually set by auser. In some embodiments, the system can be configured to automaticallyset the share parameter based upon a set of configuration rules. Thiscan allow either a user or the system to set the share parameter. Forexample, MQT 206 is defined to be ‘User Maintained’ and a user sets MQT206's share parameter to ‘Yes’. Therefore, the rows from the base tablethat are included in MQT 206 can be shared by other MQTs. In addition,MQT 204 is defined to be ‘System Maintained’ and the MQT 204's shareparameter is set to ‘Yes’. Because MQT 204's share parameter is set to‘Yes’ and MQT 206's share parameter is set to ‘Yes’, the employee'svisual image data located in MQT 206 can be shared with MQT 204, asopposed to storing another copy of the visual image data for MQT 204.

In various embodiments, the data in the database or the base table maybe changed (e.g., some or all of the data in the base table rows areinserted, updated or deleted). To maintain consistency with the changes,the MQTs may be refreshed (e.g., updated or changed). In certainembodiments, the MQTs with a share parameter set to ‘Yes’ will each havethe same refresh schedule. For instance, if MQT 204 and 206 have theirshare parameters set to ‘Yes’ then they will be refreshed at a rate thatsatisfies the refresh requirements of all MQTs. If MQT 204 and has itsshare parameters set to ‘Yes’ and MQT 206 has its share parameter set to‘No’, then MQT 204 will be refreshed at a rate that satisfies therefresh requirements for other generated MQTs (not shown in FIG. 2).However, MQT 206 can have a separate refresh rate.

In another embodiment, the system can be configured to have MQTs thathave the share parameter set to ‘Yes’ share a refresh schedule with thebase table 202. The refresh rate for these MQTs can be set according tothe respective requirements of the base table and other MQTs. Moreover,the remaining MQTs with the share parameter set to ‘No’ can be refreshedat a rate that is consistent with their respective MQT refreshrequirements. For example, if MQT 206 has its share parameter set to‘No’ then MQT 206 does not share the visual image data with MQT 204 andMQT 206 can have a refresh schedule set according to the specificrefresh requirements of MQT 206. MQT 204 can have its share parameterset to ‘Yes’ and MQT 204 can be configured with reference pointers thatpoint back to the base table to locate the employee's visual image data.MQT 204 can then be refreshed at a rate that satisfies the requirementsof both MQT 204 and the base table.

Consistent with embodiment, MQTs that are share a memory location for aLOB can get out of synchronization when they have different refreshrates (e.g., due to a manual refreshing of one MQT). If this occurs,then the system can be configured to stop sharing and instantiate aversion of the LOB for each MQT. For example MQT1 and MQT2 start bysharing a memory location of a LOB that exists separate from the basetable. The base table changes the data for the LOB such that MQT1 andMQT2 are pointing to the memory location with an old version of the LOB.If MQT1 is manually refreshed but MQT2 is not, then the system can stopthe sharing and instantiate a version of the LOB for MQT1 at a newmemory location. MQT2 will remain pointed to the old version of the LOBuntil it is also refreshed, at which point sharing could be resumed bypointing MQT2 to the new memory location. In certain embodiments, thesystem can be configured to transfer ownership of the LOB to MQT2.

FIG. 3 depicts an example 300 of generating MQTs that share data from abase table, consistent with embodiments of the present disclosure. Inparticular embodiments, the example can include a base table 202, MQTs204, 206, an index 214, a visual image storage application 226, andqueries 220, 222.

In various embodiments, the example 300 illustrated using FIG. 3 issimilar to the example illustrated using FIG. 2. According toembodiments, queries 220 and 222 can be made to the base table 202 froma client. Query 220 can be made for employee 1, 2, and 3's salary andquery 222 can be made for a visual image of employees 1, 2, and 3. Adatabase manager may recognize that queries 220 and 222 have been mademultiple times and the database manager can decide to generate MQTs 204and 206 for queries 220 and 222. The database manager can firstdetermine whether the storage size of the data in each column of therows for employees 1, 2, and 3 are above a threshold memory size. Thedatabase manager may then determine that the storage size of the datafor employee 1, 2, and 3's salary (in this case, 10 bytes) is below thethreshold memory size and copy the data into MQT 204 and MQT 206. Thedatabase manager may then determine that the storage size of the datafor the visual image of employees 1, 2, and 3 (in this case, 100gigabytes) is above the threshold memory size. The database manager maythen generate the visual image storage application 226 and copy thevisual image data into the memory location where the different MQTs canreference the data.

According to certain embodiments, the database manager can then includereference pointers 208, 210, and 212 with MQT 204 and reference pointers228, 230, and 232 with MQT 206. Reference pointer 208 can provide thelocation of the data for the visual image of employee 1 by pointing tothe cell in the visual image storage application 226 where employee 1'svisual image data is stored. Similarly, reference pointer 210 canprovide the location of the data for the visual image of employee 2 bypointing to the cell in the visual image storage application 226 whereemployee 2's visual image data is stored, and reference pointer 212 canprovide the location of the data for the visual image of employee 3 bypointing to the cell in the visual image storage application whereemployee 3's visual image data is stored.

In particular embodiments, similar to FIG. 2, index 214 can beconfigured to include storage space pointers 216 and 218 that thedatabase manager can access and use to locate MQTs 204 and 206. If query222 is made for employee 1's visual image, storage space pointer 216 canbe used to locate MQT 204. Reference pointer 208 can then be used tolocate the cell in the visual image storage application 226 for thevisual image data of employee 1. The data can then be retrieved from thevisual image storage application to satisfy query 222. Similarly,reference pointers 210 and 212 can be used to locate the data for thevisual image of employee 2 or employee 3 to satisfy query 222. Inaddition, if or when query 220 is made to the base table 202 foremployee 1, 2, or 3's salary, the database manager can access index 214and use storage space pointer 218 to locate MQT 206. If query 220 wasmade for employee 1's salary, the cell in MQT 206 of the data foremployee 1's salary can be located and the data can be retrieved tosatisfy query 220. Similarly, storage space pointer 218 can be used tolocate MQT 206 and the data for employee 2 and employee 3's salary canbe retrieved to satisfy query 220.

In various embodiments, MQTs 204 and 206 can be further configured witha share parameter. As a result, MQTs 204 and 206 in example 300 may beconfigured similar to MQTs 204 and 206 from example 200. However, thevisual image storage application 226 can provide another option whenMQTs change their share parameter. For example, as depicted in FIG. 2,MQT 204 is configured with reference pointers 208, 210, and 212 thatpoint to MQT 206. If MQT 206's share parameter was then changed from‘Yes’ to ‘No’, the reference pointers 208, 210, and 212 can no longerpoint to MQT 206. As a result, reference pointers 208, 210, and 212 canpoint to the visual image storage application 226 as depicted in FIG. 3.This can be useful because, in particular embodiments, the base table202 can have a frequent refresh schedule and it is desirable that thedata retrieved from MQT 204 is refreshed less frequently. Therefore,since the reference pointers 208, 210, and 212 can point to the visualimage storage application 226 instead of the base table 202, the dataretrieved from the visual image storage application may not be refreshedas frequently as the data in the base table.

FIG. 4 depicts an example 400 of generating MQTs that share data from abase table, consistent with embodiments of the present disclosure. Inparticular embodiments, the example 400 can include a base table 202,MQTs 204, 206, and queries 220, 222. Furthermore, MQTs 204 and 206 canbe configured to include share parameters similar to MQTs 204 and 206 ofFIG. 2.

In various embodiments, the example 400 is similar to the example 200.According to various embodiments, queries 220 and 222 can be made to thebase table 202 from a client. Query 220 can be made for employees 1, 2,and 3's salary and query 222 can be made for a visual image of employees1, 2, and 3. A database manager may recognize that queries 220 and 222have been made multiple times and the database manager can decide togenerate MQTs 204 and 206 for queries 220 and 222. The database managercan first determine whether the storage size of the data in each columnof the rows for employees 1, 2, and 3 is above a threshold memory size.The database manager may then determine that the storage size of thedata for employee 1, 2, and 3's salary (in this case, 10 bytes) is belowthe threshold memory size and copy the data into MQT 204 and MQT 206.The database manager may then determine that the storage size of thedata for the visual image of employees 1, 2, and 3 (in this case, 100gigabytes) is above the threshold memory size and not make a copy of thevisual data.

According to certain embodiments, the database manager can then includereference pointers 208, 210, and 212 with MQT 204 and reference pointers228, 230, and 232 with MQT 206. Reference pointer 208 can provide thelocation of the data for the visual image of employee 1 by pointing tothe cell in the base table 202 where the row for employee 1 and thecolumn for the visual image intersect. Similarly, reference pointer 210can provide the location of the data for the visual image of employee 2by pointing to the intersection of the row for employee 2 and the columnfor the visual image and reference pointer 212 can provide the locationof the data for the visual image of employee 3 by pointing to theintersection of the row for employee 3 and the column for the visualimage.

In particular embodiments, similar to FIG. 2, index 214 can beconfigured to include storage space pointers 216 and 218 that thedatabase manager can access and use to locate MQTs 204 and 206. If query222 is made for employee 1's visual image, storage space pointer 216 canbe used to locate MQT 204. Reference pointer 208 can then be used tolocate the cell in the base table 202 for the visual image data ofemployee 1. The data can then be retrieved from the base table tosatisfy query 222. Similarly, reference pointers 210 and 212 can be usedto locate the data for the visual image of employee 2 or employee 3 tosatisfy query 222. In addition, if or when query 220 is made to the basetable 202 for employee 1, 2, or 3's salary, the database manager canaccess index 214 and use storage space pointer 218 to locate MQT 206. Ifquery 220 was made for employee 1's salary, the cell in MQT 206 of thedata for employee 1's salary can be located and the data can beretrieved to satisfy query 220. Similarly, storage space pointer 218 canbe used to locate MQT 206 and the data for employee 2 and employee 3'ssalary can be retrieved to satisfy query 220.

The present disclosure is also directed toward embodiments that candynamically alternate between the examples 200, 300, and 400. Forexample, MQT 204 and MQT 206 can be configured with reference pointersthat point back to the base table 202, as shown in FIG. 4. MQT 204 andMQT 206 can be refreshed at different times, and the base table can havea large amount of data (e.g., visual image data) that has been changedat a time, causing the large amount of data pointed to by MQT 204 to bedifferent from the large amount of data pointed to by MQT 206. As aresult, in certain embodiments, a storage application can be generated(e.g., visual image storage application from FIG. 3) and a copy of thelarge amount of data can be made before it is changed in the base table.The copy can then be stored in the storage application and the referencepointers included with MQT 204 and MQT 206 can be dynamically redirectedto point to the storage application. In another embodiment, a copy ofthe large amount of data can be made before it is changed in the basetable. The copy can then be stored in both MQT 204 and MQT 206.

FIG. 5 depicts a method 500 of generating MQTs that share data from abase table, consistent with embodiments of the present disclosure. Inoperation 502, a query can be received. The query can be made to one ormore rows of a base table and each row can have a plurality of columns.Furthermore, the query can be recognized as having been made multipletimes. In operation 504, a column (i) that stores data can beidentified. In operation 506, it can be determined if there are any morecolumns in the row. If there are, in operation 508, the method 500 canincrement to the next column (i+1) and operations 504-506 can repeat. Ifthere are not anymore columns, in operation 510, it can be determinedwhether any of the columns have data that is above a threshold memorysize. As stated herein, the threshold memory size can be determinedbased on many factors, including but not limited to, the storagecapacity of a system (e.g., database storage server 102, client 118, andclient 122), preference settings set by the database manager or a humanadministrator, and the number of join operations required to retrieve aresult to a query. In certain embodiments, the threshold can dynamicallychange in response to system and usage parameters. For example, athreshold can be automatically adjusted based upon the amount of memorythat is allocated to queries and/or jobs, or in response to a change inthe available memory (e.g., due to a change in the memory allocated to avirtual machine). If there is data from the row that is above thethreshold memory size, in operation 512, an MQT can be generated thatincludes a reference pointer that points to the data. However, if thereis no data from the row that is above the threshold memory size, inoperation 514, an MQT can be generated that stores a copy of the row.

In operation 516, the query can be received again. In certainembodiments, an index can be used to locate the MQT. The index can beconfigured to include storage space pointers that point to storagespaces and there can be at least one pointer to the MQT. Using thepointer, the MQT can be located, and in operation 518, the generated MQTcan be accessed. Using the reference pointer included with the MQT, inoperation 520, the data can be located. In operation 522, the data canthen be retrieved to satisfy the query.

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Java, Smalltalk, C++ or the like,and conventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

It is understood in advance that although this disclosure includes adetailed description on cloud computing, implementation of the teachingsrecited herein are not limited to a cloud computing environment. Rather,embodiments of the present invention are capable of being implemented inconjunction with any other type of computing environment now known orlater developed.

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g. networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as follows:

On-demand self-service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad network access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

Resource pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand. There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter).

Rapid elasticity: capabilities can be rapidly and elasticallyprovisioned, in some cases automatically, to quickly scale out andrapidly released to quickly scale in. To the consumer, the capabilitiesavailable for provisioning often appear to be unlimited and can bepurchased in any quantity at any time.

Measured service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported providing transparency for both theprovider and consumer of the utilized service.

Service Models are as follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based email). Theconsumer does not manage or control the underlying cloud infrastructureincluding network, servers, operating systems, storage, or evenindividual application capabilities, with the possible exception oflimited user-specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems, storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as follows:

Private cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off-premises.

Community cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting for loadbalancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure comprising anetwork of interconnected nodes.

Referring now to FIG. 6, a schematic of an example of a cloud computingnode is shown. Cloud computing node 10 is only one example of a suitablecloud computing node and is not intended to suggest any limitation as tothe scope of use or functionality of embodiments of the inventiondescribed herein. Regardless, cloud computing node 10 is capable ofbeing implemented and/or performing any of the functionality set forthherein above.

In cloud computing node 10 there is a computer system/server 12, whichis operational with numerous other general purpose or special purposecomputing system environments or configurations. Examples of well-knowncomputing systems, environments, and/or configurations that may besuitable for use with computer system/server 12 include, but are notlimited to, personal computer systems, server computer systems, thinclients, thick clients, handheld or laptop devices, multiprocessorsystems, microprocessor-based systems, set top boxes, programmableconsumer electronics, network PCs, minicomputer systems, mainframecomputer systems, and distributed cloud computing environments thatinclude any of the above systems or devices, and the like.

Computer system/server 12 may be described in the general context ofcomputer system executable instructions, such as program modules, beingexecuted by a computer system. Generally, program modules may includeroutines, programs, objects, components, logic, data structures, and soon that perform particular tasks or implement particular abstract datatypes. Computer system/server 12 may be practiced in distributed cloudcomputing environments where tasks are performed by remote processingdevices that are linked through a communications network. In adistributed cloud computing environment, program modules may be locatedin both local and remote computer system storage media including memorystorage devices.

As shown in FIG. 6, computer system/server 12 in cloud computing node 10is shown in the form of a general-purpose computing device. Thecomponents of computer system/server 12 may include, but are not limitedto, one or more processors or processing units 16, a system memory 28,and a bus 18 that couples various system components including systemmemory 28 to processor 16.

Bus 18 represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. By way of example, and not limitation,such architectures include Industry Standard Architecture (ISA) bus,Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, VideoElectronics Standards Association (VESA) local bus, and PeripheralComponent Interconnect (PCI) bus.

Computer system/server 12 typically includes a variety of computersystem readable media. Such media may be any available media that isaccessible by computer system/server 12, and it includes both volatileand non-volatile media, removable and non-removable media.

System memory 28 can include computer system readable media in the formof volatile memory, such as random access memory (RAM) 30 and/or cachememory 32. Computer system/server 12 may further include otherremovable/non-removable, volatile/non-volatile computer system storagemedia. By way of example only, storage system 34 can be provided forreading from and writing to a non-removable, non-volatile magnetic media(not shown and typically called a “hard drive”). Although not shown, amagnetic disk drive for reading from and writing to a removable,non-volatile magnetic disk (e.g., a “floppy disk”), and an optical diskdrive for reading from or writing to a removable, non-volatile opticaldisk such as a CD-ROM, DVD-ROM or other optical media can be provided.In such instances, each can be connected to bus 18 by one or more datamedia interfaces. As will be further depicted and described below,memory 28 may include at least one program product having a set (e.g.,at least one) of program modules that are configured to carry out thefunctions of embodiments of the invention.

Program/utility 40, having a set (at least one) of program modules 42,may be stored in memory 28 by way of example, and not limitation, aswell as an operating system, one or more application programs, otherprogram modules, and program data. Each of the operating system, one ormore application programs, other program modules, and program data orsome combination thereof, may include an implementation of a networkingenvironment. Program modules 42 generally carry out the functions and/ormethodologies of embodiments of the invention as described herein.

Computer system/server 12 may also communicate with one or more externaldevices 14 such as a keyboard, a pointing device, a display 24, etc.;one or more devices that enable a user to interact with computersystem/server 12; and/or any devices (e.g., network card, modem, etc.)that enable computer system/server 12 to communicate with one or moreother computing devices. Such communication can occur via Input/Output(I/O) interfaces 22. Still yet, computer system/server 12 cancommunicate with one or more networks such as a local area network(LAN), a general wide area network (WAN), and/or a public network (e.g.,the Internet) via network adapter 20. As depicted, network adapter 20communicates with the other components of computer system/server 12 viabus 18. It should be understood that although not shown, other hardwareand/or software components could be used in conjunction with computersystem/server 12. Examples, include, but are not limited to: microcode,device drivers, redundant processing units, external disk drive arrays,RAID systems, tape drives, and data archival storage systems, etc.

Referring now to FIG. 7, illustrative cloud computing environment 50 isdepicted. As shown, cloud computing environment 50 comprises one or morecloud computing nodes 10 with which local computing devices used bycloud consumers, such as, for example, personal digital assistant (PDA)or cellular telephone 54A, desktop computer 54B, laptop computer 54C,and/or automobile computer system 54N may communicate. Nodes 10 maycommunicate with one another. They may be grouped (not shown) physicallyor virtually, in one or more networks, such as Private, Community,Public, or Hybrid clouds as described hereinabove, or a combinationthereof. This allows cloud computing environment 50 to offerinfrastructure, platforms and/or software as services for which a cloudconsumer does not need to maintain resources on a local computingdevice. It is understood that the types of computing devices 54A-N shownin FIG. 7 are intended to be illustrative only and that computing nodes10 and cloud computing environment 50 can communicate with any type ofcomputerized device over any type of network and/or network addressableconnection (e.g., using a web browser).

Referring now to FIG. 8, a set of functional abstraction layers providedby cloud computing environment 50 (FIG. 7) is shown. It should beunderstood in advance that the components, layers, and functions shownin FIG. 8 are intended to be illustrative only and embodiments of theinvention are not limited thereto. As depicted, the following layers andcorresponding functions are provided: Hardware and software layer 60includes hardware and software components. Examples of hardwarecomponents include mainframes, in one example IBM® zSeries® systems;RISC (Reduced Instruction Set Computer) architecture based servers, inone example IBM pSeries® systems; IBM xSeries® systems; IBM BladeCenter®systems; storage devices; networks and networking components. Examplesof software components include network application server software, inone example IBM WebSphere® application server software; and databasesoftware, in one example IBM DB2® database software. (IBM, zSeries,pSeries, xSeries, BladeCenter, WebSphere, and DB2 are trademarks ofInternational Business Machines Corporation registered in manyjurisdictions worldwide).

Virtualization layer 62 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers;virtual storage; virtual networks, including virtual private networks;virtual applications and operating systems; and virtual clients.

In one example, management layer 64 may provide the functions describedbelow. Resource provisioning provides dynamic procurement of computingresources and other resources that are utilized to perform tasks withinthe cloud computing environment. Metering and Pricing provide costtracking as resources are utilized within the cloud computingenvironment, and billing or invoicing for consumption of theseresources. In one example, these resources may comprise applicationsoftware licenses. Security provides identity verification for cloudconsumers and tasks, as well as protection for data and other resources.User portal provides access to the cloud computing environment forconsumers and system administrators. Service level management providescloud computing resource allocation and management such that requiredservice levels are met. Service Level Agreement (SLA) planning andfulfillment provide pre-arrangement for, and procurement of, cloudcomputing resources for which a future requirement is anticipated inaccordance with an SLA.

Workloads layer 66 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation; software development and lifecycle management; virtualclassroom education delivery; data analytics processing; transactionprocessing; and generating shared MQT data.

The descriptions of the various embodiments of the present disclosurehave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

1-7. (canceled)
 8. A database manager system for creating a materialized query table (MQT) for data from a base table having a plurality of rows and columns that contain stored data, the system comprising: one or more computer processor circuits configured to: receive a query to a row from the base table; identify a column in the row; determine that data from the column is above a threshold memory size; and generate, in response to determining that the data is above the threshold memory size, the MQT with a reference pointer that points to a location of the data that is in another table.
 9. The system of claim 8, wherein the one or more computer processor circuits are further configured to store the data in a second MQT.
 10. The system of claim 8, wherein the one or more computer processor circuits are further configured to store the data in the base table.
 11. The system of claim 8, wherein one or more computer processor circuits are further configured to store the data in a storage application that has a first refresh schedule that is different from a second refresh schedule of the base table.
 12. The system of claim 8, one or more computer processor circuits are further configured to configure the MQT with a share parameter that allows the MQT to access to a storage space where the data is stored.
 13. The system of claim 8, wherein the one or more computer processor circuits are further configured to: receive the query to the row; access the MQT in response to receiving the query; locate the data based on the reference pointer; and retrieve the data.
 14. The system of claim 13, wherein the one or more computer processor circuits are further configured to: access an index having a plurality of storage space pointers that point to storage spaces, each storage space pointed to by at least one storage space pointer; and locate the MQT based on a storage space pointer from the plurality of storage space pointers.
 15. A computer program product for generating a materialized query table (MQT) for data from a base table having a plurality of rows and columns that contain stored data, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, wherein the computer readable storage medium is not a transitory signal per se, the program instructions executable by a processing circuit to cause the processing circuit to perform a method comprising: receiving a query to a row from the base table; identifying a column in the row; determining that data from a cell in the row and the column is above a threshold memory size; and generating, in response to determining that the data is above the threshold memory size, the MQT from data for the row and with a reference pointer that points to a location that is shared with another table.
 16. The computer program product of claim 15, wherein the location is shared with a second MQT.
 17. The computer program product of claim 15, wherein the location is shared with the base table.
 18. The computer program product of claim 15, wherein the location is shared with a storage application that has a first refresh schedule that is different from a second refresh schedule of the base table.
 19. The computer program product of claim 15, wherein the determining is responsive to a share parameter of the MQT.
 20. The computer program product of claim 15, wherein the method further comprises: receiving another query to the row; accessing the MQT in response to receiving the another query; locating the data based on the reference pointer; and retrieving the data. 